package com.team.star.utils.pwdutils;

import cn.hutool.crypto.digest.BCrypt;

public class PasswordUtils {

    /**
     * 加密密码
     */
    public static String encrypt(String password) {
        return BCrypt.hashpw(password, BCrypt.gensalt());
    }

    /**
     * 验证密码
     */
    public static boolean decrypt(String inputPassword, String hashedPassword) {
        return BCrypt.checkpw(inputPassword, hashedPassword);
    }
}